<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增角色')" />
	<th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-gitee-add">
		<div class="col-md-12">
			<div class="form-group">
				<label class="col-sm-3 control-label">项目名称：</label>
				<div class="col-sm-9">
					<input type="text" name="gitee" class="form-control" placeholder="请输入文本">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">项目地址：</label>
				<div class="col-sm-9">
					<input type="text" name="address" class="form-control" placeholder="请输入文本">
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-12 col-sm-offset-3">
					<button type="submit" onclick="add()" class="btn btn-primary">提交</button>
					<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
				</div>
			</div>

		</div>
	</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">
	function submitHandler() {
		if ($.validate.form()) {
			add();
		}
	}
	function add() {
		var gitee = $("input[name='gitee']").val();
		var address = $("input[name='address']").val();

		$.ajax({
			cache : true,
			type : "POST",
			url : ctx + "system/gitee/add",
			data : {
				"gitee": gitee,
				"address": address
			},
			async : false,
			error : function(request) {
				$.modal.alertError("系统错误");
			},
			success : function(data) {
				$.operate.successCallback(data);
			}
		});
	}
</script>
</body>
</html>
